package nmp.lib;

import java.util.ArrayList;

public interface CNmpCmd {
	
	public static final int NMP_CMD_ID_IDENTIFY = 1;
	public static final int NMP_CMD_ID_WIFILIST = 2;
	public static final int NMP_CMD_ID_WIFICONNECT = 3;
	public static final int NMP_CMD_ID_WIFIDISCONNECT = 4;
	public static final int NMP_CMD_ID_DEVICEINFO = 5;
	public static final int NMP_CMD_ID_WIFICONFIG = 6;
	public static final int NMP_CMD_ID_WIFIISCONNECTED = 7;
	
	public class NmpWifiInfo {
		public String ssid;
		public String protect;
		public int strength;
		public int status;
		public String password;
	};
	
	public class NmpCmdBase{
		public int id;
		public int session;
		public String command;
	};
	
	public class NmpCmdIdentifyInfo extends NmpCmdBase {
		public String name;
		public int version;
	};
	
	public class NmpCmdIsConnected extends NmpCmdBase {
		public int isconnected;
	};	
	
	public class NmpCmdWifiList extends NmpCmdBase {
		public String name;
		public String version;
		public ArrayList<NmpWifiInfo> list;
	};

	public class NmpCmdDeviceInfo extends NmpCmdBase {
		public String ssid;
		public String password;
		public String name;
		public String mac;
		public int firmware_majon;
		public int firmware_minor;
	};	
	
	public NmpCmdBase Parse(String jsonstr);
	
	public String IdentifyRequestGenerate(String name,int version);
	
	public String WifiListRequestGenerate();
	
	public String WifiConnectRequestGenerate(String ssid, String protect,String password);
	
	public String WifiDisconnectRequestGenerate();
	
	public String DeviceInfoRequestGenerate();
	
	public String WifiConfigRequestGenerate(String ssid, String protect,String password);
	
	public String WifiIsConnectedRequestGenerate();
}
